' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 '   F i l e   n a m e :     W X M _ 0 0 6 _ D E M O _ 1 0 . t x t                                           D a t e :   0 9   A P R   2 0 2 0 
 
 ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 '   M i c r o S t e p p e r   s t e p p e r     s t e p   f o r   r u n 
 
 ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 '   G e a r   r a t i o : 
 
 '         M o t o r 0   5 0 : 1           C B = 1 / 8   s t e p = 1 6 0 0 
 
 '         M o t o r 1   3 0 : 1           C B = 1 / 8   S t e p = 1 6 0 0 
 
 '         M o t o r Z     1 :   4 m m       C = 1 / 8   S t e p = 1 6 0 0 
 
 ' 
 
 '       M 0   m a x   s p e e d   6 0 0 0       a c c   3 5 0     s t e p   x   m m   2 2 8 
 
 '       M 1   m a x   s p e e d   8 0 0 0       a c c   5 0 0     s t e p   x   m m   1 3 3 
 
 '       M 2   m a x   s p e e d   5 0 0 0       a c c   2 0 0     s t e p   x   m m   4 0 0 
 
 ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 '   L I M I T S 
 
 '     M 0 :     m i n :     6 8       m a x :   3 1 0 
 
 '     M 1 :     m i n :     3 2       m a x :   3 2 0 
 
 '     M 2 :     m i n :   1 3 0       m a x :   2 9 0 
 
 ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 
 
 L o a d   P O C . j p g 
 
 S p e e d   9 
 
 
 
 B u t t o n     1   T e x t   " H o m e " 
 
 B u t t o n     1   C o l o r   L i g h t C y a n 
 
 B u t t o n     2   T e x t   " H o m i n g _ M 0 " 
 
 B u t t o n     2   C o l o r   L i g h t C y a n 
 
 B u t t o n     3   T e x t   " H o m i n g _ M 1 " 
 
 B u t t o n     3   C o l o r   L i g h t C y a n 
 
 B u t t o n     4   T e x t   " H o m i n g _ M 2 - ( Z ) " 
 
 B u t t o n     4   C o l o r   L i g h t C y a n 
 
 ' B u t t o n     5   T e x t   " H o m i n g _ M 3 - ( R ) " 
 
 ' B u t t o n     5   C o l o r   L i g h t C y a n 
 
 ' B u t t o n     6   T e x t   " H o m i n g _ M 4 - ( B ) " 
 
 ' B u t t o n     6   C o l o r   P a l e G r e e n 
 
 ' B u t t o n     7   T e x t   " H o m i n g _ M 5 - ( C ) " 
 
 ' B u t t o n     7   C o l o r   P a l e G r e e n 
 
 B u t t o n     8   T e x t   " A l l   S c i u s c i a " 
 
 B u t t o n     8   C o l o r   C o r n f l o w e r B l u e 
 
 
 
 B u t t o n     9   T e x t   " M 0   9 0 " 
 
 B u t t o n     9   C o l o r   P a l e G r e e n 
 
 B u t t o n     1 0   T e x t   " M 0   2 7 0 " 
 
 B u t t o n     1 0   C o l o r   P a l e G r e e n 
 
 B u t t o n     1 1   T e x t   " M 1   9 0 " 
 
 B u t t o n     1 1   C o l o r   P a l e G r e e n 
 
 B u t t o n     1 2   T e x t   " M 1   2 7 0 " 
 
 B u t t o n     1 2   C o l o r   P a l e G r e e n 
 
 B u t t o n     1 3   T e x t   " M 2   1 9 0 " 
 
 B u t t o n     1 3   C o l o r   P a l e G r e e n 
 
 B u t t o n     1 4   T e x t   " M 2   6 0 " 
 
 B u t t o n     1 4   C o l o r   P a l e G r e e n 
 
 
 
 B u t t o n   1 6   T e x t   " C L O S E   A L L " 
 
 B u t t o n   1 6   C o l o r   R e d 
 
 
 
 B u t t o n   1 7   T e x t   " S C I U S C I A   M 0 " 
 
 B u t t o n   1 7   C o l o r   A q u a m a r i n e 
 
 B u t t o n   1 8   T e x t   " S C I U S C I A   M 1 " 
 
 B u t t o n   1 8   C o l o r   A q u a m a r i n e 
 
 B u t t o n   1 9   T e x t   " S C I U S C . M 2 ( Z ) " 
 
 B u t t o n   1 9   C o l o r   A q u a m a r i n e 
 
 ' B u t t o n   2 0   T e x t   " S C I U S C . M 3 ( R ) " 
 
 ' B u t t o n   2 0   C o l o r   A q u a m a r i n e 
 
 
 
 B u t t o n   2 4   T e x t   " R e d " 
 
 B u t t o n   2 4   C o l o r   R e d 
 
 B u t t o n   2 5   T e x t   " Y e l l o w " 
 
 B u t t o n   2 5   C o l o r   Y e l l o w 
 
 B u t t o n   2 6   T e x t   " G r e e n " 
 
 B u t t o n   2 6   C o l o r   G r e e n 
 
 B u t t o n   2 7   T e x t   " B l u " 
 
 B u t t o n   2 7   C o l o r   B l u e 
 
 
 
 B u t t o n   2 8   T e x t   " W h i t e " 
 
 B u t t o n   2 8   C o l o r   W h i t e 
 
 
 
 B u t t o n   2 9   T e x t   " S t a r t   V a c u u m " 
 
 B u t t o n   2 9   C o l o r   B l u e 
 
 B u t t o n   3 0   T e x t   " S t o p   V a c u u m " 
 
 B u t t o n   3 0   C o l o r   B l u e 
 
 B u t t o n   3 1   T e x t   " E n a b l e   M o t o r s " 
 
 B u t t o n   3 1   C o l o r   T a n 
 
 B u t t o n   3 2   T e x t   " D i s a b l e   M o t o r s " 
 
 B u t t o n   3 2   C o l o r   T a n 
 
 
 
 ' K e y   5   	 	 	 G o s u b   F a r F o m Z e r o 
 
 K e y   R i g h t 	 	 G o s u b   M o v e R i g h t 
 
 K e y   L e f t   	 	 G o s u b   M o v e L e f t 
 
 K e y   U p   	 	 	 G o s u b   M o v e U p 
 
 K e y   D o w n   	 	 G o s u b   M o v e D o w n 
 
 K e y   P a g e u p 	 	 G o s u b   M o v e U p p e r 
 
 K e y   P a g e d o w n 	 G o s u b   M o v e L o w e r 
 
 K e y   M 	 	 	 G o s u b   " E n a b l e   M o t o r s " 
 
 
 
 V a r i a b l e   N u m e r i c   S l o t _ M 0 
 
 V a r i a b l e   N u m e r i c   S l o t _ M 1 
 
 V a r i a b l e   N u m e r i c   S l o t _ M 2 
 
 V a r i a b l e   N u m e r i c   S l o t _ M 3 
 
 V a r i a b l e   N u m e r i c   S l o t _ M 4 
 
 V a r i a b l e   N u m e r i c   S l o t _ M 5 
 
 V a r i a b l e   N u m e r i c   S l o t _ M 6 
 
 V a r i a b l e   N u m e r i c   S l o t _ M 7 
 
 V a r i a b l e   N u m e r i c   S l o t _ M 8 
 
 
 
 V a r i a b l e   N u m e r i c   S l o t _ S e n s o r M 0 
 
 V a r i a b l e   N u m e r i c   S l o t _ S e n s o r M 1 
 
 V a r i a b l e   N u m e r i c   S l o t _ S e n s o r M 2 
 
 V a r i a b l e   N u m e r i c   S l o t _ S e n s o r M 3 
 
 V a r i a b l e   N u m e r i c   S l o t _ S e n s o r M 4 
 
 V a r i a b l e   N u m e r i c   S l o t _ S e n s o r M 5 
 
 V a r i a b l e   N u m e r i c   S l o t _ S e n s o r M 6 
 
 V a r i a b l e   N u m e r i c   S l o t _ S e n s o r M 7 
 
 V a r i a b l e   N u m e r i c   S l o t _ S e n s o r M 8 
 
 
 
 V a r i a b l e   N u m e r i c   S l o t _ E n a b l e M o t o r s 
 
 V a r i a b l e   N u m e r i c   S l o t _ L e d R 
 
 V a r i a b l e   N u m e r i c   S l o t _ L e d G 
 
 V a r i a b l e   N u m e r i c   S l o t _ L e d B 
 
 V a r i a b l e   N u m e r i c   S l o t _ V a c u u m 
 
 
 
 S l o t _ M 0   =   1 
 
 S l o t _ M 1   =   3 
 
 S l o t _ M 2   =   5 
 
 S l o t _ M 3   =   7 
 
 S l o t _ M 4   =   - 1 
 
 S l o t _ M 5   =   - 1 
 
 S l o t _ M 6   =   3 7 
 
 S l o t _ M 7   =   3 9 
 
 S l o t _ M 8   =   4 1 
 
 
 
 S l o t _ S e n s o r M 0   =   1 9 
 
 S l o t _ S e n s o r M 1   =   1 9 
 
 S l o t _ S e n s o r M 2   =   2 1 
 
 S l o t _ S e n s o r M 3   =   4 0 
 
 S l o t _ S e n s o r M 4   =   - 1 
 
 S l o t _ S e n s o r M 5   =   - 1 
 
 S l o t _ S e n s o r M 6   =   - 1 
 
 S l o t _ S e n s o r M 7   =   - 1 
 
 S l o t _ S e n s o r M 8   =   - 1 
 
 
 
 S l o t _ E n a b l e M o t o r s   =   1 1 
 
 S l o t _ L e d R   =   1 6 
 
 S l o t _ L e d G   =   1 7 
 
 S l o t _ L e d B   =   1 8 
 
 S l o t _ V a c u u m   =   4 6 
 
 
 
 L o a d   V a r s 
 
 P o s M 0   =   v 1 
 
 P o s M 1   =   v 2 
 
 P o s M 2   =   v 3 
 
 P o s M 3   =   v 4 
 
 P o s M 4   =   v 5 
 
 P o s M 5   =   v 6 
 
 G o s u b   P r i n t V a l u e s 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   L O A D   E X T E R N A L   P R O G R A M S 
 
 L o a d   " T h e r e m i n o _ H A L \ T h e r e m i n o _ H A L . e x e " 
 
 L o a d   " T h e r e m i n o _ H A L \ T h e r e m i n o _ S l o t V i e w e r _ 1 . e x e " 
 
 L o a d   " T h e r e m i n o _ H A L \ T h e r e m i n o _ S l o t V i e w e r _ 2 . e x e " 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   T E S T   M A S T E R   P R E S E N T 
 
 ' W a i t   S e c o n d s   1 
 
 F o r   v 1   =   1   T o   9 9 9 9 
 
 	 I f   S l o t ( 0 )   > =   1   A n d   S l o t ( 0 )   < =   4 
 
 	 	 E x i t 
 
 	 E n d I f 
 
 	 
 
 	 P r i n t   "   I n v a l i d   m a s t e r   n u m b e r :   "   +   S l o t ( 0 ) 
 
 	 S l o t   0   =   R e c o g n i z e 
 
 	 B e e p 
 
 	 W a i t   S e c o n d s   2 
 
 N e x t 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   C O L O R 
 
 
 
 G o s u b   " W H I T E " 
 
 W a i t   S e c o n d s   0 . 2 
 
 
 
 G o s u b   " R E D " 
 
 W a i t   S e c o n d s   0 . 2 
 
 
 
 G o s u b   " G R E E N " 
 
 W a i t   S e c o n d s   0 . 2 
 
 
 
 G o s u b   " B L U " 
 
 W a i t   S e c o n d s   0 . 2 
 
 
 
 L o a d   H i d e 
 
 S t o p 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     S E Q U E N C E S 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 
 
 L a b e l   " A l l   S c i u s c i a " 
 
 	 B u t t o n   8   C o l o r   F l a s h i n g 8   R e d   B l a c k 
 
 	 G o s u b   H o m e 
 
 	 F o r   v 8   =   1   T o   1 0 
 
 	 	 S e q u e n c e F i l e N a m e   =   " S E Q U E N C E S \ S e q u e n c e _ A l l S c i u s c i a . s e q " 
 
 	 	 G o s u b   E x e c S e q u e n c e 
 
 	 	 P r i n t   " C y c l e   n u m . :   "   +   V 8 
 
 	 N e x t 
 
 	 B u t t o n   8   C o l o r   A q u a m a r i n e 
 
 R e t u r n 
 
 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     S I M P L E   O P E R A T I O N S 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 
 
 L a b e l   " M 0   9 0 " 
 
 	 G o s u b   " E n a b l e   M o t o r s " 
 
 	 S l o t   S l o t _ M 0   =   9 0 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 R e t u r n 
 
 
 
 L a b e l   " M 0   2 7 0 " 
 
 	 G o s u b   " E n a b l e   M o t o r s " 
 
 	 S l o t   S l o t _ M 0   =   2 7 0 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 R e t u r n 
 
 
 
 L a b e l   " M 1   9 0 " 
 
 	 G o s u b   " E n a b l e   M o t o r s " 
 
 	 S l o t   S l o t _ M 1   =   9 0 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 R e t u r n 
 
 
 
 L a b e l   " M 1   2 7 0 " 
 
 	 G o s u b   " E n a b l e   M o t o r s " 
 
 	 S l o t   S l o t _ M 1   =   2 7 0 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 R e t u r n 
 
 
 
 L a b e l   " M 2   1 9 0 " 
 
 	 G o s u b   " E n a b l e   M o t o r s " 
 
 	 S l o t   S l o t _ M 2   =   1 9 0 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 R e t u r n 
 
 
 
 L a b e l   " M 2   6 0 " 
 
 	 G o s u b   " E n a b l e   M o t o r s " 
 
 	 S l o t   S l o t _ M 2   =   6 0 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     F U N C T I O N S 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 
 
 L a b e l   " A l l _ S c i u s c i a " 
 
 	 B u t t o n   8   C o l o r   F l a s h i n g 8   R e d   B l a c k 
 
 	 G o s u b   H o m e 
 
 	 F o r   v 8   =   1   T o   1 0 
 
 	 	 G o s u b   " S c i u s c i a   M 0 " 
 
 	 	 G o s u b   " S c i u s c i a   M 1 " 
 
 	 	 G o s u b   " S c i u s c . M 2 ( Z ) " 
 
 	 	 P r i n t   " C y c l e   n u m . :   "   +   V 8 
 
 	 N e x t 
 
 	 B u t t o n   8   C o l o r   A q u a m a r i n e 
 
 R e t u r n 
 
 
 
 
 
 L a b e l   " S C I U S C I A   M 0 " 
 
 	 B u t t o n   1 7   C o l o r   F l a s h i n g 8   R e d   B l a c k 
 
 	 G o s u b   H o m e 
 
 	 G o s u b   " E n a b l e   M o t o r s " 
 
 	 F o r   v 1   =   1   T o   3 0 
 
 	 	 S l o t   S l o t _ M 0   =   7 0 	 	 '   M 0 :   m i n :   6 8 
 
 	 	 G o s u b   W a i t A l l M o t o r s 
 
 	 	 S l o t   S l o t _ M 0   =   3 1 0             '   M 0 :   m a x :   3 1 0 
 
 	 	 G o s u b   W a i t A l l M o t o r s 
 
 	 	 P r i n t   " C y c l e   n u m . :   "   +   V 9 
 
 	 N e x t 
 
 	 S l o t   S l o t _ M 0   =   1 8 0 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 B u t t o n   1 7   C o l o r   A q u a m a r i n e 
 
 R e t u r n 
 
 
 
 L a b e l   " S C I U S C I A   M 1 " 
 
 	 B u t t o n   1 8   C o l o r   F l a s h i n g 8   R e d   B l a c k 
 
 	 G o s u b   H o m e 
 
 	 G o s u b   " E n a b l e   M o t o r s " 
 
 	 F o r   v 9   =   1   T o   3 0 
 
 	 	 S l o t   S l o t _ M 1   =   3 5 	 	 '   M 1 :   m i n :   3 2 
 
 	 	 G o s u b   W a i t A l l M o t o r s 
 
 	 	 S l o t   S l o t _ M 1   =   3 1 8             '   M 1 :   m a x :   3 1 0 
 
 	 	 G o s u b   W a i t A l l M o t o r s 
 
 	 	 P r i n t   " C y c l e   n u m . :   "   +   V 9 
 
 	 N e x t 
 
 	 S l o t   S l o t _ M 1   =   1 8 0 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 B u t t o n   1 8   C o l o r   A q u a m a r i n e 
 
 R e t u r n 
 
 
 
 L a b e l   " S C I U S C . M 2 ( Z ) " 
 
 	 B u t t o n   1 9   C o l o r   F l a s h i n g 8   R e d   B l a c k 
 
 	 G o s u b   H o m e 
 
 	 G o s u b   " E n a b l e   M o t o r s " 
 
 	 F o r   v 9   =   1   T o   3 
 
 	 	 S l o t   S l o t _ M 2   =   6 0 	 	 '   M 2 : 
 
 	 	 G o s u b   W a i t A l l M o t o r s 
 
 	 	 S l o t   S l o t _ M 2   =   1 9 0             '   M 2 :   m a x :   1 9 0 
 
 	 	 G o s u b   W a i t A l l M o t o r s 
 
 	 	 P r i n t   " C y c l e   n u m . :   "   +   V 9 
 
 	 N e x t 
 
 	 S l o t   S l o t _ M 2   =   1 4 0 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 B u t t o n   1 9   C o l o r   A q u a m a r i n e 
 
 R e t u r n 
 
 
 
 ' L a b e l   " S C I U S C . M 3 ( R ) " 	 	 '   V a c u u m   p i c k   r o t a t i o n 
 
 ' 	 B u t t o n   2 0   C o l o r   F l a s h i n g 8   R e d   B l a c k 
 
 ' 	 G o s u b   " " E n a b l e   M o t o r s " " 
 
 ' 	 G o s u b   " H o m i n g _ M 3 - ( R ) " 
 
 ' 	 F o r   v 9   =   1   T o   1 0 
 
 ' 	 	 S l o t   S l o t _ M 3   =   9 0 	 	 '   M 3 :   m i n : 
 
 ' 	 	 G o s u b   W a i t A l l M o t o r s 
 
 ' 	 	 S l o t   S l o t _ M 3   =   2 7 0             '   M 3 :   m a x : 
 
 ' 	 	 G o s u b   W a i t A l l M o t o r s 
 
 ' 	 	 P r i n t   " C y c l e   n u m . :   "   +   V 9 
 
 ' 	 N e x t 
 
 ' 	 B u t t o n   2 0   C o l o r   A q u a m a r i n e 
 
 ' R e t u r n 
 
 
 
 
 
 
 
 L a b e l   " E n a b l e   M o t o r s " 
 
 	 S l o t   S l o t _ E n a b l e M o t o r s   =   1 0 0 0   	 	 ' E n a b l e   M o t o r s 
 
 R e t u r n 
 
 
 
 L a b e l   " D i s a b l e   M o t o r s " 
 
 	 S l o t   S l o t _ E n a b l e M o t o r s   =   0   	                 ' D i s a b l e   M o t o r s 
 
 R e t u r n 
 
 
 
 
 
 '   = = = = = = = = = = = = = = =   H O M E   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   H o m e 
 
 	 G o s u b   " E n a b l e   M o t o r s " 
 
 	 G o s u b   H o m i n g _ M 2 - ( Z ) 
 
 	 G o s u b   H o m i n g _ M 0 
 
 	 G o s u b   H o m i n g _ M 1 
 
 	 G o s u b   H O M I N G _ M 3 - ( R ) 
 
 	 ' S l o t   S l o t _ M 0   =   9 0 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     H O M I N G   M 0   M 1   M 2   M 3   ( M 4 )   ( M 5 ) 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   " H o m i n g _ M 0 " 
 
 	 G o s u b   " E n a b l e   M o t o r s " 
 
 	 S l o t M o t o r   =   S l o t _ M 0 
 
 	 S l o t S e n s o r   =   S l o t _ S e n s o r M 0 
 
 	 S p e e d S e a r c h   =   - 0 . 1 1     	 '   0 . 0 4   s e a r c h   d i r e c t i o n   a n d   s p e e d 
 
 	 S p e e d R e t u r n   =   + 0 . 0 1 5 	 '   0 . 0 2   r e t u r n   d i r e c t i o n   a n d   s p e e d 
 
 	 D e c l a r e d Z e r o   =   7 0 . 6 9 	 '   d e c l a r e d   s w i t c h   a n g l e 
 
 	 I n i t i a l P o s i t i o n   =   1 8 0 	 '   m o v e   t o   t h i s   a n g l e 
 
 	 G o s u b   H o m e M o t o r 
 
 	 P o s M 0   =   1 8 0 
 
 	 G o s u b   P r i n t V a l u e s 
 
 R e t u r n 
 
 
 
 L a b e l   " H o m i n g _ M 1 " 
 
 	 G o s u b   " E n a b l e   M o t o r s " 
 
 	 S l o t M o t o r   =   S l o t _ M 1 
 
 	 S l o t S e n s o r   =   S l o t _ S e n s o r M 1 
 
 	 S p e e d S e a r c h   =   - 0 . 0 8 	 	 '   0 . 0 6   s e a r c h   d i r e c t i o n   a n d   s p e e d 
 
 	 S p e e d R e t u r n   =   + 0 . 0 1 5 	 	 '   r e t u r n   d i r e c t i o n   a n d   s p e e d 
 
 	 D e c l a r e d Z e r o   =   2 9 	 	 ' 3 3 . 3   d e c l a r e d   s w i t c h   a n g l e 
 
 	 I n i t i a l P o s i t i o n   =   1 8 0 	 '   m o v e   t o   t h i s   a n g l e 
 
 	 G o s u b   H o m e M o t o r 
 
 	 P o s M 1   =   1 8 0 
 
 	 G o s u b   P r i n t V a l u e s 
 
 R e t u r n 
 
 
 
 L a b e l   " H o m i n g _ M 2 - ( Z ) " 
 
 	 G o s u b   " E n a b l e   M o t o r s " 
 
 	 S l o t M o t o r   =   S l o t _ M 2 
 
 	 S l o t S e n s o r   =   S l o t _ S e n s o r M 2 
 
 	 S p e e d S e a r c h   =   + 0 . 0 4 	 	 '   s e a r c h   d i r e c t i o n   a n d   s p e e d 
 
 	 S p e e d R e t u r n   =   - 0 . 0 2 	 	 '   r e t u r n   d i r e c t i o n   a n d   s p e e d 
 
 	 D e c l a r e d Z e r o   =   1 9 2 	 	 '   d e c l a r e d   s w i t c h   a n g l e 
 
 	 I n i t i a l P o s i t i o n   =   1 9 0 	 '   m o v e   t o   t h i s   a n g l e 
 
 	 G o s u b   H o m e M o t o r 
 
 	 P o s M 2   =   2 9 0 
 
 	 G o s u b   P r i n t V a l u e s 
 
 R e t u r n 
 
 
 
 L a b e l   " H o m i n g _ M 3 - ( R ) " 
 
 	 G o s u b   " E n a b l e   M o t o r s " 
 
 	 S l o t M o t o r   =   S l o t _ M 3 
 
 	 S l o t ( S l o t M o t o r )   =   R e s e t 
 
 	 W a i t   S e c o n d s   0 . 0 8 
 
 	 S l o t ( S l o t M o t o r )   =   0 
 
 	 W a i t   S e c o n d s   0 . 3       	 	 ' M E C H A N I C A L   S T A B I L I Z A T I O N 
 
 	 S l o t   S l o t _ M 3   =   - 3 6 0 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t ( S l o t M o t o r )   =   R e s e t 
 
 	 W a i t   S e c o n d s   0 . 3 	 	 ' M E C H A N I C A L   S T A B I L I Z A T I O N 
 
 	 S l o t ( S l o t M o t o r )   =   0 
 
 	 W a i t   S e c o n d s   0 . 0 8 
 
 	 S l o t   S l o t _ M 3   =   1 5 9 
 
 	 G o s u b   P r i n t V a l u e s 
 
 R e t u r n 
 
 
 
 ' L a b e l   H o m i n g _ M 4 - ( B ) 
 
 ' 	 G o s u b   " E n a b l e   M o t o r s " 
 
 ' 	 S l o t M o t o r   =   S l o t _ M 4 
 
 ' 	 S l o t S e n s o r   =   S l o t _ S e n s o r M 4 
 
 ' 	 S p e e d S e a r c h   =   - 0 . 6 	 	 '   s e a r c h   d i r e c t i o n   a n d   s p e e d 
 
 ' 	 S p e e d R e t u r n   =   + 0 . 4 	 	 '   r e t u r n   d i r e c t i o n   a n d   s p e e d 
 
 ' 	 D e c l a r e d Z e r o   =   0 	 	 '   d e c l a r e d   s w i t c h   a n g l e 
 
 ' 	 I n i t i a l P o s i t i o n   =   1 0 	 '   m o v e   t o   t h i s   a n g l e 
 
 ' 	 G o s u b   H o m e M o t o r 
 
 ' 	 P o s M 4   =   1 0 
 
 ' 	 G o s u b   P r i n t V a l u e s 
 
 ' R e t u r n 
 
 
 
 ' L a b e l   H o m i n g _ M 5 - ( C ) 
 
 ' 	 G o s u b   " E n a b l e   M o t o r s " 
 
 ' 	 S l o t M o t o r   =   S l o t _ M 5 
 
 ' 	 S l o t S e n s o r   =   S l o t _ S e n s o r M 5 
 
 ' 	 S p e e d S e a r c h   =   - 0 . 6 	 	 '   s e a r c h   d i r e c t i o n   a n d   s p e e d 
 
 ' 	 S p e e d R e t u r n   =   + 0 . 4 	 	 '   r e t u r n   d i r e c t i o n   a n d   s p e e d 
 
 ' 	 D e c l a r e d Z e r o   =   0 	 	 '   d e c l a r e d   s w i t c h   a n g l e 
 
 ' 	 I n i t i a l P o s i t i o n   =   1 0 	 '   m o v e   t o   t h i s   a n g l e 
 
 ' 	 G o s u b   H o m e M o t o r 
 
 ' 	 P o s M 4   =   1 0 
 
 ' 	 G o s u b   P r i n t V a l u e s 
 
 ' R e t u r n 
 
 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     H o m e   t h e   M o t o r ( S l o t M o t o r )   t o   t h e   S e n s o r ( S l o t S e n s o r ) 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 V a r i a b l e   N u m e r i c   S l o t M o t o r 
 
 V a r i a b l e   N u m e r i c   S l o t S e n s o r 
 
 V a r i a b l e   N u m e r i c   S p e e d S e a r c h 
 
 V a r i a b l e   N u m e r i c   S p e e d R e t u r n 
 
 V a r i a b l e   N u m e r i c   D e c l a r e d Z e r o 
 
 V a r i a b l e   N u m e r i c   I n i t i a l P o s i t i o n 
 
 
 
 L a b e l   H o m e M o t o r 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - -   d e t a c h   i f   s e n s o r   i s   a c t i v e 
 
 	 I f   S l o t ( S l o t S e n s o r )   >   5 0 0   O r   K e y ( " C T R L " ) 
 
 	 	 S l o t ( S l o t M o t o r )   =   S l o t ( S l o t M o t o r )   +   S p e e d R e t u r n 
 
 	 E n d I f 
 
         '   - - - - - - - - - - - - - - - - - - - - - - - - -   s e a r c h   t h e   s e n s o r 
 
 L a b e l   S e a r c h H o m e 
 
 	 S l o t ( S l o t M o t o r )   =   S l o t ( S l o t M o t o r )   +   S p e e d S e a r c h 
 
 	 W a i t   S e c o n d s   0 . 0 0 1 
 
 	 I f   S l o t ( S l o t S e n s o r )   >   5 0 0   O r   K e y ( " C T R L " ) 
 
 	 	 G o s u b   W a i t M o t o r 
 
 	 	 G o t o   D e t a c h S e n s o r 
 
 	 E n d I f 
 
 G o t o   S e a r c h H o m e 
 
         '   - - - - - - - - - - - - - - - - - - - - - - - - -   d e t a c h   f r o m   t h e   s e n s o r 
 
 L a b e l   D e t a c h S e n s o r 
 
 	 S l o t ( S l o t M o t o r )   =   S l o t ( S l o t M o t o r )   +   S p e e d R e t u r n 
 
 	 W a i t   S e c o n d s   0 . 0 0 1 
 
 	 I f   S l o t   ( S l o t S e n s o r )   <   5 0 0 
 
 	 	 G o s u b   W a i t M o t o r 
 
 	 	 G o t o   A s s i g n Z e r o 
 
 	 E n d I f 
 
 G o t o   D e t a c h S e n s o r 
 
         '   - - - - - - - - - - - - - - - - - - - - - - - - -   r e s e t   a n d   m o v e   t o   I n i t i a l P o s 
 
 L a b e l   A s s i g n Z e r o 
 
 	 S l o t ( S l o t M o t o r )   =   R e s e t 
 
 	 W a i t   S e c o n d s   0 . 0 8 
 
 	 S l o t ( S l o t M o t o r )   =   D e c l a r e d Z e r o 
 
 	 G o s u b   W a i t M o t o r 
 
 	 S l o t ( S l o t M o t o r )   =   I n i t i a l P o s i t i o n 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '       W a i t   u n t i l   t h e   m o t o r ( S l o t M o t o r )   i s   s t o p p e d 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   W a i t M o t o r 
 
 	 W a i t   S e c o n d s   0 . 1 
 
 	 L a b e l   W a i t 1 
 
 	 	 I f   A b s ( S l o t ( S l o t M o t o r   +   1 ) )   <   0 . 0 1 
 
 	 	 	 R e t u r n 
 
 	 	 E n d I f 
 
 	 	 W a i t   S e c o n d s   0 . 0 0 5 
 
 	 G o t o   W a i t 1 
 
 G o t o   W a i t M o t o r 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '       W a i t   u n t i l   a l l   t h e   M o t o r s   ( 0 , 1 , 2 , 3 , 4 , 5 )   a r e   s t o p p e d 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   W a i t A l l M o t o r s 
 
 	 W a i t   S e c o n d s   0 . 1                     '   < < <   e n s u r e s   t h a t   m o t o r s   a r e   r e a l l y   s t a r t e d 
 
 	 L a b e l   W a i t A l l M o t o r s 2 
 
 	 	 I f   A b s ( S l o t ( S l o t _ M 0   +   1 ) )   <   0 . 0 1   O r   S l o t _ M 0   <   0 
 
 	 	 	 I f   A b s ( S l o t ( S l o t _ M 1   +   1 ) )   <   0 . 0 1     O r   S l o t _ M 1   <   0 
 
 	 	 	 	 I f   A b s ( S l o t ( S l o t _ M 2   +   1 ) )   <   0 . 0 1     O r   S l o t _ M 2   <   0 
 
 	 	 	 	 	 I f   A b s ( S l o t ( S l o t _ M 3   +   1 ) )   <   0 . 0 1     O r   S l o t _ M 3   <   0 
 
 	 	 	 	 	 	 I f   A b s ( S l o t ( S l o t _ M 4   +   1 ) )   <   0 . 0 1     O r   S l o t _ M 4   <   0 
 
 	 	 	 	 	 	 	 I f     A b s ( S l o t ( S l o t _ M 5   +   1 ) )   <   0 . 0 1   O r   S l o t _ M 5   <   0 
 
 	 	 	 	 	 	 	 	 I f     A b s ( S l o t ( S l o t _ M 6   +   1 ) )   <   0 . 0 1   O r   S l o t _ M 6   <   0 
 
 	 	 	 	 	 	 	 	 	 I f     A b s ( S l o t ( S l o t _ M 7   +   1 ) )   <   0 . 0 1   O r   S l o t _ M 7   <   0 
 
 	 	 	 	 	 	 	 	 	 	 I f     A b s ( S l o t ( S l o t _ M 8   +   1 ) )   <   0 . 0 1   O r   S l o t _ M 8   <   0 
 
 	 	 	 	 	 	 	 	 	 	 	 R e t u r n 
 
 	 	 	 	 	 	 	 	 	 	 E n d I f 
 
 	 	 	 	 	 	 	 	 	 E n d I f 
 
 	 	 	 	 	 	 	 	 E n d I f 
 
 	 	 	 	 	 	 	 E n d I f 
 
 	 	 	 	 	 	 E n d I f 
 
 	 	 	 	 	 E n d I f 
 
 	 	 	 	 E n d I f 
 
 	 	 	 E n d I f 
 
 	 	 E n d I f 
 
 	 	 W a i t   S e c o n d s   0 . 0 1 
 
 	 G o t o   W a i t A l l M o t o r s 2 
 
 G o t o   W a i t A l l M o t o r s 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     L E D   C O L O R S 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   " R e d " 
 
 	 S l o t   S l o t _ L e d R   =   1 0 0 0 
 
 	 S l o t   S l o t _ L e d G   =   0 
 
 	 S l o t   S l o t _ L e d B   =   0 
 
 R e t u r n 
 
 
 
 L a b e l   " G r e e n " 
 
 	 S l o t   S l o t _ L e d R   =   0 
 
 	 S l o t   S l o t _ L e d G   =   1 0 0 0 
 
 	 S l o t   S l o t _ L e d B   =   0 
 
 R e t u r n 
 
 
 
 L a b e l   " B l u " 
 
 	 S l o t   S l o t _ L e d R   =   0 
 
 	 S l o t   S l o t _ L e d G   =   0 
 
 	 S l o t   S l o t _ L e d B   =   1 0 0 0 
 
 R e t u r n 
 
 
 
 L a b e l   " W h i t e " 
 
 	 S l o t   S l o t _ L e d R   =   1 0 0 0 
 
 	 S l o t   S l o t _ L e d G   =   1 0 0 0 
 
 	 S l o t   S l o t _ L e d B   =   1 0 0 0 
 
 R e t u r n 
 
 
 
 L a b e l   " Y e l l o w " 
 
 	 S l o t   S l o t _ L e d R   =   1 0 0 0 
 
 	 S l o t   S l o t _ L e d G   =   9 0 0 
 
 	 S l o t   S l o t _ L e d B   =   0 
 
 R e t u r n 
 
 
 
 L a b e l   " N O C O L O R " 
 
 	 S l o t   S l o t _ L e d R   =   0 
 
 	 S l o t   S l o t _ L e d G   =   0 
 
 	 S l o t   S l o t _ L e d B   =   0 
 
 R e t u r n 
 
 
 
 L a b e l   " S t a r t   V a c u u m " 
 
 	 S l o t   S l o t _ V a c u u m   =   1 0 0 0 
 
 	 W a i t   S e c o n d s   0 . 5 
 
 R e t u r n 
 
 
 
 L a b e l   " S t o p   V a c u u m " 
 
 	 S l o t   S l o t _ V a c u u m   =   0 
 
 	 W a i t   S e c o n d s   0 . 5 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     J O G 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   M o v e R i g h t 
 
 	 G o s u b   " E n a b l e   M o t o r s " 
 
 	 G o s u b   S p e e d M o d i f i e r s 
 
 	 P o s M 0   =   P o s M 0   +   J o g S p e e d 
 
 	 S l o t   S l o t _ M 0   =   P o s M 0 
 
 	 G o s u b   P r i n t V a l u e s 
 
 R e t u r n 
 
 
 
 L a b e l   M o v e L e f t 
 
 	 G o s u b   " E n a b l e   M o t o r s " 
 
 	 G o s u b   S p e e d M o d i f i e r s 
 
 	 P o s M 0   =   P o s M 0   -   J o g S p e e d 
 
 	 S l o t   S l o t _ M 0   =   P o s M 0 
 
 	 G o s u b   P r i n t V a l u e s 
 
 R e t u r n 
 
 
 
 L a b e l   M o v e U p 
 
 	 G o s u b   " E n a b l e   M o t o r s " 
 
 	 G o s u b   S p e e d M o d i f i e r s 
 
 	 P o s M 1   =   P o s M 1   +   J o g S p e e d 
 
 	 S l o t   S l o t _ M 1   =   P o s M 1 
 
 	 G o s u b   P r i n t V a l u e s 
 
 R e t u r n 
 
 
 
 L a b e l   M o v e D o w n 
 
 	 G o s u b   " E n a b l e   M o t o r s " 
 
 	 G o s u b   S p e e d M o d i f i e r s 
 
 	 P o s M 1   =   P o s M 1   -   J o g S p e e d 
 
 	 S l o t   S l o t _ M 1   =   P o s M 1 
 
 	 G o s u b   P r i n t V a l u e s 
 
 R e t u r n 
 
 
 
 L a b e l   M o v e U p p e r 
 
 	 G o s u b   " E n a b l e   M o t o r s " 
 
 	 G o s u b   S p e e d M o d i f i e r s 
 
 	 P o s M 2   =   P o s M 2   +   J o g S p e e d 
 
 	 S l o t   S l o t _ M 2   =   P o s M 2 
 
 	 G o s u b   P r i n t V a l u e s 
 
 R e t u r n 
 
 
 
 L a b e l   M o v e L o w e r 
 
 	 G o s u b   " E n a b l e   M o t o r s " 
 
 	 G o s u b   S p e e d M o d i f i e r s 
 
 	 P o s M 2   =   P o s M 2   -   J o g S p e e d 
 
 	 S l o t   S l o t _ M 2   =   P o s M 2 
 
 	 G o s u b   P r i n t V a l u e s 
 
 R e t u r n 
 
 
 
 V a r i a b l e   N u m e r i c   J o g S p e e d 
 
 L a b e l   S p e e d M o d i f i e r s 
 
 	 J o g S p e e d   =   0 . 1 
 
 	 S e l e c t   T r u e 
 
 	 	 C a s e   K e y ( " S H I F T " ) 
 
 	 	 	 J o g S p e e d   =   J o g S p e e d   *   1 0 0 
 
 	 	 C a s e   K e y ( " C T R L " ) 
 
 	 	 	 J o g S p e e d   =   J o g S p e e d   *   1 0 
 
 	 	 C a s e   K e y ( " A L T " ) 
 
 	 	 	 J o g S p e e d   =   J o g S p e e d   *   0 . 1 
 
 	 E n d S e l e c t 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     P R I N T   M O T O R   P O S I T I O N S 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 V a r i a b l e   N u m e r i c   P o s M 0 
 
 V a r i a b l e   N u m e r i c   P o s M 1 
 
 V a r i a b l e   N u m e r i c   P o s M 2 
 
 V a r i a b l e   N u m e r i c   P o s M 3 
 
 V a r i a b l e   N u m e r i c   P o s M 4 
 
 V a r i a b l e   N u m e r i c   P o s M 5 
 
 
 
 L a b e l   P r i n t V a l u e s 
 
 	 s 1   =                 " M 0   =   "   +   F o r m a t ( P o s M 0 ,   " 0 . 0 0 " ) 
 
 	 s 1   =   s 1   +   "     M 1   =   "   +   F o r m a t ( P o s M 1 ,   " 0 . 0 0 " ) 
 
 	 s 1   =   s 1   +   "     M 2   =   "   +   F o r m a t ( P o s M 2 ,   " 0 . 0 0 " ) 
 
 	 s 1   =   s 1   +   "     M 3   =   "   +   F o r m a t ( P o s M 3 ,   " 0 . 0 0 " ) 
 
 	 s 1   =   s 1   +   "     M 4   =   "   +   F o r m a t ( P o s M 4 ,   " 0 . 0 0 " ) 
 
 	 s 1   =   s 1   +   "     M 5   =   "   +   F o r m a t ( P o s M 5 ,   " 0 . 0 0 " ) 
 
 	 P r i n t   s 1 
 
 R e t u r n 
 
 
 
 ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 ' - - - - -   C L O S I N G   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 
 
 L a b e l   " C L O S E   A L L " 
 
 	 L o a d   C l o s e A p p s 
 
 R e t u r n 
 
 
 
 L a b e l   " E v e n t S t o p " 
 
 	 v 1   =   P o s M 0 
 
 	 v 2   =   P o s M 1 
 
 	 v 3   =   P o s M 2 
 
 	 v 4   =   P o s M 3 
 
 	 v 5   =   P o s M 4 
 
 	 v 6   =   P o s M 5 
 
 	 S a v e   V a r s 
 
 	 G o s u b   " D i s a b l e   M o t o r s " 
 
 	 W i n d o w   S i z a b l e 
 
 E n d 
 
 
 
 
 
 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     S E Q U E N C E   E X A M P L E S 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   " D e m o S e q " 
 
 	 S e q u e n c e F i l e N a m e   =   " S E Q U E N C E S \ S e q u e n c e _ D e m o S e q . s e q " 
 
 	 G o s u b   " E x e c S e q u e n c e " 
 
 R e t u r n 
 
 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     S E Q U E N C E   L O A D I N G   A N D   E X E C U T I O N 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 V a r i a b l e   S t r i n g   S e q u e n c e F i l e N a m e 
 
 V a r i a b l e   S t r i n g   S e q u e n c e 
 
 V a r i a b l e   S t r i n g   S e q u e n c e C m d 
 
 V a r i a b l e   N u m e r i c   S e q u e n c e I n d e x 
 
 V a r i a b l e   N u m e r i c   S e q u e n c e L e n g t h 
 
 
 
 L a b e l   E x e c S e q u e n c e 
 
 	 L o a d   S e q u e n c e   S e q u e n c e F i l e N a m e 
 
 	 I f   L e n ( S e q u e n c e )   =   0 
 
 	 	 C o n t r o l s   O p e n T e x t B o x 
 
 	 	 P r i n t   C R L F   +   "   S e q u e n c e   f i l e   n o t   f o u n d :   "   +   S e q u e n c e F i l e N a m e 
 
 	 	 B e e p 
 
 	 	 S t o p 
 
 	 E n d I f 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 	 V a r i a b l e   N u m e r i c   E x e c S e q u e n c e S t a r t T i m e 
 
 	 E x e c S e q u e n c e S t a r t T i m e   =   E l a p s e d T i m e 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 	 S e q u e n c e L e n g t h   =   G e t S e p a r a t e d S t r i n g C o u n t ( S e q u e n c e ,   C R L F ) 
 
 	 F o r   S e q u e n c e I n d e x   =   0   T o   S e q u e n c e L e n g t h - 1 
 
 	 	 S e q u e n c e C m d   =   G e t S e p a r a t e d S t r i n g ( S e q u e n c e ,   S e q u e n c e I n d e x ,   C R L F ) 
 
 	 	 S e q u e n c e C m d   =   R e p l a c e ( S e q u e n c e C m d ,   C h r ( 9 ) ,   "   " )   ' T A B S   t o   S P A C E S 
 
 	 	 S e q u e n c e C m d   =   R e m o v e C o m m e n t s ( S e q u e n c e C m d ) 
 
 	 	 S e q u e n c e C m d   =   T r i m ( S e q u e n c e C m d ) 
 
 	 	 ' 
 
 	 	 P r i n t   "   E x e c u t i n g   c o m m a n d :   "   +   S e q u e n c e C m d 
 
 	 	 ' 
 
 	 	 S e l e c t   U C a s e ( S e q u e n c e C m d ) 
 
                         '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   E n d   s e q u e n c e 
 
 	 	 	 C a s e   " E N D S E Q " 
 
 	 	 	 	 S e q u e n c e I n d e x   =   S e q u e n c e L e n g t h - 1 
 
 	 	       '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   A C T I O N S 
 
 	 	 	 C a s e   " E N A B L E M O T O R S "           ' e n a b l e   m o v e m e n t   m o t o r s 
 
 	 	 	 	 G o s u b   " E n a b l e   M o t o r s " 
 
 	 	 	 C a s e   " D I S A B L E M O T O R S "         ' d i s a b l e   m o v e m e n t   m o t o r s 
 
 	 	 	 	 G o s u b   " D i s a b l e   M o t o r s " 
 
 	 	 	 C a s e   " S T A R T V A C U U M "               ' S t a r t   V a c u u m 
 
 	 	 	 	 G o s u b   " S t a r t   V a c u u m " 
 
 	 	 	 C a s e   " S T O P V A C U U M "                 ' S t o p   V a c u u m 
 
 	 	 	 	 G o s u b   " S t o p   V a c u u m " 
 
 	 	 	 C a s e   " H O M E " 
 
 	 	 	 	 G o s u b   " H O M E " 
 
 	 	 	 C a s e   " H O M I N G _ M 0 " 
 
 	 	 	 	 G o s u b   " H o m i n g _ M 0 " 
 
 	 	 	 C a s e   " H O M I N G _ M 1 " 
 
 	 	 	 	 G o s u b   " H o m i n g _ M 1 " 
 
 	 	 	 C a s e   " H O M I N G _ M 2 " 
 
 	 	 	 	 G o s u b   " H o m i n g _ M 2 - ( Z ) " 
 
 	 	 	 C a s e   " H O M I N G _ M 3 - ( R ) " 
 
 	 	 	 	 G o s u b   " H o m i n g _ M 3 - ( R ) " 
 
 	 	 	 C a s e   " C L O S E A L L " 
 
 	 	 	 	 G o s u b   " C L O S E   A L L " 
 
 	 	 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   C O L O R S 
 
 	 	 	 C a s e   " R E D " 
 
 	 	 	 	 G o s u b   " R E D " 
 
 	 	 	 C a s e   " G R E E N " 
 
 	 	 	 	 G o s u b   " G R E E N " 
 
 	 	 	 C a s e   " B L U " 
 
 	 	 	 	 G o s u b   " B L U " 
 
 	 	 	 C a s e   " Y E L L O W " 
 
 	 	 	 	 G o s u b   " Y e l l o w " 
 
 	 	 	 C a s e   " W H I T E " 
 
 	 	 	 	 G o s u b   " W H I T E " 
 
 	 	 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   W A I T   M O T O R S 
 
 	 	 	 C a s e   " W A I T A L L M O T O R S " 
 
 	 	 	 	 G o s u b   W a i t A l l M o t o r s 
 
                         '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   W i t h   p a r a m e t e r s 
 
 	 	 	 C a s e E l s e 
 
 	 	 	 	 s 1   =   G e t S e p a r a t e d S t r i n g ( S e q u e n c e C m d ,   0 ) 
 
 	 	 	 	 S e l e c t   U C a s e ( s 1 ) 
 
 	 	 	 	 	 C a s e   " M O V E " 
 
 	 	 	 	 	 	 M o t o r N u m b e r   =   G e t S e p a r a t e d S t r i n g ( S e q u e n c e C m d ,   1 ) 
 
 	 	 	 	 	 	 G o s u b   M o t o r N u m b e r T o S l o t 
 
 	 	 	 	 	 	 S l o t ( M o t o r S l o t )   =   G e t S e p a r a t e d S t r i n g ( S e q u e n c e C m d ,   2 ) 
 
 	 	 	 	 	 	 G o s u b   W a i t A l l M o t o r s 
 
 	 	 	 	 	 C a s e   " M O V E S L O W " 
 
 	 	 	 	 	 	 M o t o r N u m b e r   =   G e t S e p a r a t e d S t r i n g ( S e q u e n c e C m d ,   1 ) 
 
 	 	 	 	 	 	 G o s u b   M o t o r N u m b e r T o S l o t 
 
 	 	 	 	 	 	 M o v e S l o w _ D e s t   =   G e t S e p a r a t e d S t r i n g ( S e q u e n c e C m d ,   2 ) 
 
 	 	 	 	 	 	 M o v e S l o w _ S p e e d   =   G e t S e p a r a t e d S t r i n g ( S e q u e n c e C m d ,   3 ) 
 
 	 	 	 	 	 	 G o s u b   M o v e S l o w 
 
 	 	 	 	 	 C a s e   " P A U S E " 
 
 	 	 	 	 	 	 W a i t   S e c o n d s   G e t S e p a r a t e d S t r i n g ( S e q u e n c e C m d ,   1 ) 
 
 	 	 	 	 	 	 
 
 	 	 	 	 	 C a s e E l s e 
 
 	 	 	 	 	 	 I f   s 1   < >   " " 
 
 	 	 	 	 	 	 	 C o n t r o l s   O p e n T e x t B o x 
 
 	 	 	 	 	 	 	 P r i n t   C R L F   +   "   U n r e c o g n i z e d   c o m m a n d :   "   +   S e q u e n c e C m d 
 
 	 	 	 	 	 	 	 B e e p 
 
 	 	 	 	 	 	 	 S t o p 
 
 	 	 	 	 	 	 E n d I f 
 
 	 	 	 	 E n d S e l e c t 
 
 	 	 E n d S e l e c t 
 
 	 N e x t 
 
 	 S e q u e n c e F i l e N a m e   =   R e p l a c e ( S e q u e n c e F i l e N a m e , " . s e q " , " " ) 
 
 	 P r i n t   S e q u e n c e F i l e N a m e   +   "   e x e c u t e d   i n   "   +   F o r m a t ( E l a p s e d T i m e   -   E x e c S e q u e n c e S t a r t T i m e ,   " 0 . 0 0 " )   +   "   s e c o n d s " 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     M O T O R   N U M B E R   T O   S L O T   C O N V E R S I O N 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 V a r i a b l e   N u m e r i c   M o t o r N u m b e r 
 
 V a r i a b l e   N u m e r i c   M o t o r S l o t 
 
 
 
 L a b e l   M o t o r N u m b e r T o S l o t 
 
 	 S e l e c t   M o t o r N u m b e r 
 
 	 	 C a s e   0 
 
 	 	 	 M o t o r S l o t   =   S l o t _ M 0 
 
 	 	 C a s e   1 
 
 	 	 	 M o t o r S l o t   =   S l o t _ M 1 
 
 	 	 C a s e   2 
 
 	 	 	 M o t o r S l o t   =   S l o t _ M 2 
 
 	 	 C a s e   3 
 
 	 	 	 M o t o r S l o t   =   S l o t _ M 3 
 
 	 	 C a s e   4 
 
 	 	 	 M o t o r S l o t   =   S l o t _ M 4 
 
 	 	 C a s e   5 
 
 	 	 	 M o t o r S l o t   =   S l o t _ M 5 
 
 	 	 C a s e   6 
 
 	 	 	 M o t o r S l o t   =   S l o t _ M 6 
 
 	 	 C a s e   7 
 
 	 	 	 M o t o r S l o t   =   S l o t _ M 7 
 
 	 	 C a s e   8 
 
 	 	 	 M o t o r S l o t   =   S l o t _ M 8 
 
 	 E n d S e l e c t 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     S T E P P E R - M O T O R S   M O V E   S L O W 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 V a r i a b l e   N u m e r i c   M o v e S l o w _ S l o t   	 	 '   m o t o r   s l o t 
 
 V a r i a b l e   N u m e r i c   M o v e S l o w _ D e s t   	 	 '   d e s t i n a t i o n   i n   m m   o r   d e g r e e 
 
 V a r i a b l e   N u m e r i c   M o v e S l o w _ S p e e d   	 '   s p e e d   i n   m m / s e c 
 
 
 
 V a r i a b l e   N u m e r i c   M S V 1 
 
 V a r i a b l e   N u m e r i c   M S V 2 
 
 V a r i a b l e   N u m e r i c   M S V 3 
 
 V a r i a b l e   N u m e r i c   M S V 4 
 
 
 
 L a b e l   M o v e S l o w 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   g e t   t h e   a c t u a l   p o s i t i o n 
 
 	 M S V 2   =   S l o t ( M o v e S l o w _ S l o t ) 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   t e s t   f o r   v e r y   l o w   s p e e d 
 
 	 I f   M o v e S l o w _ S p e e d   <   0 . 1 
 
 	 	 M o v e S l o w _ S p e e d   =   1 
 
 	 E n d I f 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   c a l c   t h e   m o v e m e n t   i n   m m 
 
 	 M S V 1   =   M o v e S l o w _ D e s t   -   M S V 2 
 
 	 M S V 3   =   M S V 1   *   M S V 1 
 
 	 M S V 3   =   S q r t ( M S V 3 ) 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   c a l c   t h e   l o o p s   c o u n t 
 
 	 M S V 4   =   M S V 3   /   0 . 0 1   ' < < <   l o o p   t i m e 
 
 	 M S V 4   =   I n t ( M S V 4   /   M o v e S l o w _ S p e e d ) 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   t o o   m u c h   s p e e d   ? 
 
 	 I f   M S V 4   =   0 
 
 	 	 M S V 2   =   M o v e S l o w _ D e s t 
 
 	 	 S l o t ( M o v e S l o w _ S l o t )   =   M S V 2 
 
 	 	 R e t u r n 
 
 	 E n d I f 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   p r e p a r e   t h e   i n c r e m e n t s 
 
 	 M S V 1   =   ( M o v e S l o w _ D e s t   -   M S V 2 )   /   M S V 4 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   l o o p   f o r   v 4   t i m e s 
 
 	 F o r   M S V 3   =   1   T o   M S V 4 
 
 	 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   i n c r e m e n t ,   m o v e   a n d   w a i t 
 
 	 	 M S V 2   =   M S V 2   +   M S V 1 
 
 	 	 S l o t ( M o v e S l o w _ S l o t )   =   M S V 2 
 
 	 	 W a i t   S e c o n d s   0 . 0 1   ' < < <   l o o p   t i m e 
 
 	 N e x t 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 R e t u r n 
 
 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     E N D   P R O G R A M   I F   M A S T E R   E R R O R 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 ' L a b e l   E v e n t T i m e r 
 
 ' 	 I f   D e c o d e C o m m a n d S l o t ( 0 )   =   " M a s t e r   d i s c o n n e c t e d   E R R O R " 
 
 ' 	 	 E n d 
 
 ' 	 E n d I f 
 
 ' R e t u r n 
 
 
 
 
 
 ' = = = = = =   D U M M Y   A R E A   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 
 
 ' = = = = = =   T O   D O   A R E A   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 
 
 
 
 ' W A T C H   S e q u e n c e C m d 
 
 ' W A T C H   s 1 
 
 ' W A T C H   U C a s e ( S e q u e n c e C m d ) 
 
 